/**
* \file	ASTChecker.h
* \author	Caio Arce Nishibe (caionishibe@gmail.com)
* \date	August, 2014
* \brief	AST Checker header.
*/


#ifndef __AST_CHECK_H
#define __AST_CHECK_H

#include "IVisitor.h"
#include "SymbolTable.h"
#include <iostream>

using namespace std;

/**
* \brief	AST Checker
* \details	Perform type checking and build a symbol table.
* \author	Caio Arce Nishibe (caionishibe@gmail.com)
* \date	August, 2014
*/
class ASTChecker : public IVisitor
{
private:
	/**
	 * \brief symbol table
	 */
	SymbolTable *symbTab;
public:
	/**
	 * \brief Constructor
	 * \param symbTab	pointer to the symbol table
	 */
	ASTChecker(SymbolTable *symbTab);
	/*
	 * \brief Destructor
	 */
	~ASTChecker();

	void VisitProgram(ASTNode *node);
	void VisitName(ASTNode *node);
	void VisitVariable(ASTNode *node);
	void VisitRules(ASTNode *node);
	void VisitRulesSet(ASTNode *node);
	void VisitRule(ASTNode *node);
	void VisitCondition(ASTNode *node);
	void VisitLogicOperator(ASTNode *node);
	void VisitInternalCondition(ASTNode *node);
	void VisitComparationOperator(ASTNode *node);
	void VisitArithmeticOperator(ASTNode *node);
	void VisitArithmeticExpression(ASTNode *node);
	void VisitAction(ASTNode * node);
	void VisitCommand(ASTNode * node);;
	void VisitCmd(ASTNode *node);
	void VisitAssignment(ASTNode *node);
	void VisitReadSensor(ASTNode *node);
	void VisitWriteActuator(ASTNode *node);
	void VisitIdentifier(ASTNode *node);
	void VisitNumber(ASTNode *node);
	void VisitMessage(ASTNode *node);
};

#endif